package com.jswl.training.springjpa.exception;

import com.jswl.training.springjpa.common.state.Result;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 统一异常处理
 */
@RestControllerAdvice
public class ExceptionHandler {

    @org.springframework.web.bind.annotation.ExceptionHandler(value=Exception.class)
    public Result commonException(Exception e){
        return Result.error(e.getMessage());
    }


}
